package com.example.common.core.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

@AllArgsConstructor
@Getter
@ToString
public enum ResultCode {
    //操作唱功
    SUCCESS(1000, "操作成功"),
    //服务器内部错误，友好提⽰
    ERROR(2000, "服务繁忙请稍后重试"),
    //操作失败，但是服务器不存在异常
    FAILED(3000, "操作失败"),
    FAILED_UNAUTHORIZED(3001, "未授权"),
    FAILED_PARAMS_VALIDATE(3002, "参数校验失败"),
    FAILED_NOT_EXISTS(3003, "资源不存在"),
    FAILED_ALREADY_EXISTS(3004, "资源已存在"),
    AILED_USER_EXISTS(3101, "用户已存在"),
    FAILED_USER_NOT_EXISTS(3102, "用户不存在"),
    FAILED_LOGIN(3103, "用户名或密码错误"),
    FAILED_USER_BANNED(3104, "您已被列⼊⿊名单, 请联系管理员."),

    /*
     *题目相关
     */
    SUCCES_ADD_QUESTION(1001, "新增题目成功"),
    FAILED_ADD_QUESTION(1002, "新增题目失败"),
    FAILED_GET_QUESTION(1003, "获取题目详情失败"),
    FAILED_ADD_QUESTION_FOR_REPEATED_TITLE(1004, "新增题目失败，重复的题目标题"),
    FAILED_EDIT_QUESTION(1004, "编辑题目失败，请稍后重试"),
    SUCCES_EDIT_QUESTION(1005, "编辑题目成功");

    /**
     * 状态码
     */
    private int code;
    /**
     * 状态描述
     */
    private String msg;
}
